Repository navigation
Conversation
The formatter moves with 1.61. The metadata source quotes its column and constraint lists with array_map instead of an array_walk that the analyzer cannot follow through the by-reference callback, and reads the permitted values from a match that is known to exist, so the implode and array-index findings go away. The redundant hostname docblock is gone, and the createStatement docblock no longer claims an mysqli instance, which the parameter does not require. The two remaining findings are the analyzer's model of the mysqli resource, which cannot express the driver's createStatement and getResource contract; they are baselined, as the sibling createResult finding already was. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The decorators become plain statement subclasses. Sql\Platform returns them from the factory methods whose statements mysql renders differently, so Select, CreateTable and AlterTable carry the dialect from construction, and AdapterPlatform exposes the factory through getStatementFactory(). Select keeps the offset-without-limit specification rewrite in prepareSpecifications(), which replaces the localizeVariables() override that existed to wrap the subject copy. Connection::\ is declared mixed to match AbstractConnection, which phpdb 0.6.x typed; the untyped property was a fatal error against that release. The analyzer baseline is regenerated against the new dependency. php-db/phpdb resolves from the companion phpdb branch until it is released. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to php-db/phpdb#258, which moves statement construction onto the platform. This is the driver half of the change.
Sql\Select,Sql\Ddl\CreateTableandSql\Ddl\AlterTablereplaceSelectDecorator,CreateTableDecoratorandAlterTableDecorator. They are plain subclasses of the standard statements and no longer implementPlatformDecoratorInterfaceor hold a subject.Sql\Platformoverrides the three factory methods whose statements mysql renders differently and returns those classes. The remaining statements come from the standard factory unchanged.AdapterPlatform::getSqlPlatformDecorator()becomesgetStatementFactory().Select::prepareSpecifications()replaces thelocalizeVariables()override, which only existed to run after the subject copy. The offset-without-limit specification rewrite is unchanged.Connection::$resourceis declaredmixedto matchAbstractConnection, which phpdb 0.6.x typed. The untyped property is a fatal error against that release, so it also fixes installing this package against phpdb 0.6.x.php-db/phpdbresolves from the phpdb branch until #258 is released, at which point therepositoriesentry and the constraint revert.Why: the dialect is known when the platform is selected, so the statement can be built as its dialect class instead of being copied into a decorator at render time.
The first commit brings the tree in line with Mago 1.61.
Mago 1.61 code changes
src/Connection.php:128
redundant-docblock-type- /** @var string|null $hostname */ $hostname = $findParameterValue(['hostname', 'host']);src/Driver.php:81
incompatible-parameter-typeThe finding it still raises is the analyzer's model of the mysqli resource, and is baselined beside the existing
createResultentry.src/Metadata/Source.php:52, 145, 265, 320, 376, 479, 554
invalid-argument,imprecise-type554 calls
quoteIdentifierrather thanquoteIdentifierChain.src/Metadata/Source.php:98
possibly-undefined-int-array-index,possibly-null-argument